//
//  SecondModel.m
//  Model
//
//  Created by ChuXiang on 15/11/10.
//  Copyright © 2015年 ChuXiang. All rights reserved.
//

#import "SecondModel.h"

@implementation SecondModel
- (instancetype)initWithData:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqual:@"list"]) {
        NSArray *array = value;
        NSMutableArray *array1 = [[NSMutableArray alloc] initWithCapacity:0];
        for (NSDictionary *dic in array) {
            ThrithModel *thrith = [[ThrithModel alloc] initWithData:dic];
            [array1 addObject:thrith];
        }
//        NSLog(@"%@", )
        _dataSource = [[NSArray alloc] initWithArray:array1];
//        NSLog(@"%@", _dataSource);
    }
}
@end
